package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.MyEnterpriseVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/1/13 14:45:58
 * 修改备注：
 * ================================================
 */

public class MyEnterpriseHolder extends BaseViewHolder<MyEnterpriseVO> {

    private TextView tvName;//公司
    private TextView tvConcern;//关注


    public MyEnterpriseHolder(ViewGroup parent) {
        super(parent, R.layout.item_my_enterprise);

        tvName = $(R.id.tv_name);
        tvConcern = $(R.id.tv_concern);
    }

    @Override
    public void setData(final MyEnterpriseVO data) {
        super.setData(data);

        tvName.setText(data.getName());
        if (data.getIsConcern().equals("0")){
            tvConcern.setText("关注");
            tvConcern.setBackgroundResource(R.drawable.shape_red_radius_12dp);
            tvConcern.setTextColor(getContext().getResources().getColor(R.color.colorRed));
        }else{
            tvConcern.setText("已关注");
            tvConcern.setBackgroundResource(R.drawable.shape_gray_d_radius_12dp);
            tvConcern.setTextColor(getContext().getResources().getColor(R.color.colorFontLightGrayD));
        }
    }

}
